
<?

require_once ("application.list.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;

$indexes = array (
	title=>array (label=>"Title",order=>"DEFAULT",wrapper=>"vmc_icon_note"),
	details=>array (label=>"Details",order=>"DEFAULT",callback=>"_template_list_substring",length=>26),
	user_name=>array (label=>"User",order=>"DEFAULT",wrapper=>"vmc_icon_user"),
	cdate=>array (label=>"Begin Date",order=>"DEFAULT",wrapper=>"vmc_icon_date"),
);

$object_ctl = "/admin/projects/projects/fs_projects.php?fs_tab=notes&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_notes&fs_action=view&";
$link_options = "&fs_action=view&fs_tab=notes&project_id={$_REQUEST["project_id"]}";
$list_options = array (
	array (
		label=>"Add Project Note",
		link=>"fs_projects.php?fs_tab=notes&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_notes&fs_action=addnew"
	),
);

$_OBJECT_IFACE_LIST = _app_create_list_object (array (
                db_conn=>$_GLOBAL_DBH,
                indexes=>$indexes,
		list_count=>"SELECT COUNT(*) FROM project_notes WHERE project_id={$_REQUEST["project_id"]}",
		list_select=>"SELECT project_notes.*,CONCAT(last,', ',first) AS user_name FROM project_notes,users WHERE project_id={$_REQUEST["project_id"]} AND user_id=users.id",
                list_id=>"lc_project_notes",
                list_options=>$list_options,
                primary_key=>"id",
                primary_relation=>"note_id",
                link_options=>$link_options,
                object_ctl=>$object_ctl
));


$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_IFACE_LIST);

?>
